﻿using System.Diagnostics;
using System.Net;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace PMRC.API.Controllers
{
	[Route("api/home")]
	[ApiController]
	public class HomeController : ControllerBase
	{
		private readonly ILogger<HomeController> _logger;

		public HomeController(ILogger<HomeController> logger)
		{
			_logger = logger;
		}

		[HttpGet("init")]
		public IActionResult Init()
		{
			var typeSelection = new List<object>
			{
				new { id = 1,name="全部"},
				new { id = 1,name="CF"},
				new { id = 1,name="篮球"},
				new { id = 1,name="飞盘"},
				new { id = 1,name="腰旗橄榄球"}
			};

			var activityList = new List<object>()
			{
				new
				{
					Name="蓝色港湾跑步活动",
					StartTime ="2023-09-13-18:00",
					Address ="朝阳区蓝色港湾BlueGlass广场店",
					StartType ="未开始"
				},
				new
				{
					Name="蓝色港湾跑步活动",
					StartTime ="2023-09-13-18:00",
					Address ="朝阳区蓝色港湾BlueGlass广场店",
					StartType ="未开始"
				},
				new
				{
					Name="蓝色港湾跑步活动",
					StartTime ="2023-09-13-18:00",
					Address ="朝阳区蓝色港湾BlueGlass广场店",
					StartType ="未开始"
				},new
				{
					Name="蓝色港湾跑步活动",
					StartTime ="2023-09-13-18:00",
					Address ="朝阳区蓝色港湾BlueGlass广场店",
					StartType ="未开始"
				},
				new
				{
					Name="蓝色港湾跑步活动",
					StartTime ="2023-09-13-18:00",
					Address ="朝阳区蓝色港湾BlueGlass广场店",
					StartType ="未开始"
				}
			};

			return Ok(new
			{
				Content = "<H1>PMRC</H1><H3>原始人俱乐部</H3><h3>欢迎你的加入</h3>",
				TypeSelection = typeSelection,
				ActivityList = activityList
			});
		}

		/// <summary>
		/// 获取活动信息
		/// </summary>
		/// <param name="id"></param>
		/// <returns></returns>
		[HttpGet("getActiveInfo/{id}")]
		public IActionResult GetActiveInfo(int id)
		{
			var activityList = new List<object>()
			{
				new
				{
					Name="蓝色港湾跑步活动",
					StartTime ="2023-09-13-18:00",
					Address ="朝阳区蓝色港湾BlueGlass广场店",
					StartType ="未开始"
				},
				new
				{
					Name="蓝色港湾跑步活动",
					StartTime ="2023-09-13-18:00",
					Address ="朝阳区蓝色港湾BlueGlass广场店",
					StartType ="未开始"
				},
				new
				{
					Name="蓝色港湾跑步活动",
					StartTime ="2023-09-13-18:00",
					Address ="朝阳区蓝色港湾BlueGlass广场店",
					StartType ="未开始"
				},new
				{
					Name="蓝色港湾跑步活动",
					StartTime ="2023-09-13-18:00",
					Address ="朝阳区蓝色港湾BlueGlass广场店",
					StartType ="未开始"
				},
				new
				{
					Name="蓝色港湾跑步活动",
					StartTime ="2023-09-13-18:00",
					Address ="朝阳区蓝色港湾BlueGlass广场店",
					StartType ="未开始"
				}
			};
			return Ok(activityList);
		}
	}
}
